package com.ruoyi.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IndirectMapper;
import com.ruoyi.system.domain.Indirect;
import com.ruoyi.system.service.IIndirectService;

/**
 * 间接费用Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-04
 */
@Service
public class IndirectServiceImpl implements IIndirectService
{
    @Autowired
    private IndirectMapper indirectMapper;

    /**
     * 查询间接费用
     *
     * @param id 间接费用主键
     * @return 间接费用
     */
    @Override
    public Indirect selectIndirectById(Long id)
    {
        return indirectMapper.selectIndirectById(id);
    }

    /**
     * 查询间接费用列表
     *
     * @param indirect 间接费用
     * @return 间接费用
     */
    @Override
    public List<Indirect> selectIndirectList(Indirect indirect)
    {
        return indirectMapper.selectIndirectList(indirect);
    }

    /**
     * 新增间接费用
     *
     * @param indirect 间接费用
     * @return 结果
     */
    @Override
    public int insertIndirect(Indirect indirect)
    {
        return indirectMapper.insertIndirect(indirect);
    }

    /**
     * 修改间接费用
     *
     * @param indirect 间接费用
     * @return 结果
     */
    @Override
    public int updateIndirect(Indirect indirect)
    {
        return indirectMapper.updateIndirect(indirect);
    }

    /**
     * 批量删除间接费用
     *
     * @param ids 需要删除的间接费用主键
     * @return 结果
     */
    @Override
    public int deleteIndirectByIds(Long[] ids)
    {
        return indirectMapper.deleteIndirectByIds(ids);
    }

    /**
     * 删除间接费用信息
     *
     * @param id 间接费用主键
     * @return 结果
     */
    @Override
    public int deleteIndirectById(Long id)
    {
        return indirectMapper.deleteIndirectById(id);
    }

    @Override
    public int checkIndirectByProjectCodeAndNameId(String projectCode, Integer nameId) {
        return indirectMapper.selectIndirectByProjectCodeAndNameId(projectCode,nameId);
    }



    @Override
    public int countIndirectByProjectCodeAndNumber(Indirect indirect) {
        return indirectMapper.countIndirectByProjectCodeAndNumber(indirect);
    }
}
